function Animal(race, description) {
    this.race = race || "动物";
    this.description = description || "生物";
}

Animal.prototype.descript = function () {
    console.log(this.race + "是一种" + this.description);
};

function Tiger(name) {
    this.name = name || this.race;
}
Tiger.prototype = new Animal("老虎", "猫科动物");
Tiger.prototype.do = function (behaviour) {
    if (behaviour) console.log(this.name + "在" + behaviour);
    else console.log(this.name + "没做什么");
};

xiaohuang = new Tiger("小黄");
xiaohuang.descript();
xiaohuang.do("睡觉");
